package com.usian.service.impl;

import com.usian.mapper.UserMapper;
import com.usian.pojo.User;
import com.usian.service.UserService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

        private final static Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
    @Autowired
    private UserMapper userMapper;

    @Override
    public void insertUser(User user) {
        logger.debug("================用户保存service");
        userMapper.insertUser(user);
    }

    @Override
    public List<User> findAll(Integer userId) {
        return userMapper.findAll(userId);
    }

    @Override
    public List<User> findList() {
        return userMapper.findList();
    }

    @Override
    public void delete(Integer userId) {
        userMapper.delete(userId);
    }

    @Override
    public User findByid(Integer userId) {
       return   userMapper.findByid(userId);
    }

    @Override
    public void update(User user) {
        userMapper.update(user);
    }

    @Override
    public void testCorn() {


        logger.info("service add user ...........");
    }
}
